package com.vg.view;

import vg.com.chatonline.activity.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import br.com.dina.ui.widget.UITableView_User;

public class ProfileUserFragment extends Fragment {

	private UITableView_User tableView,tableView_name;
	//UIButton_User buttonview;
	private static Fragment instace = null;

	private ProfileUserFragment() {
		// TODO Auto-generated constructor stub
	}

	/* Kiem tra neu = null thi khoi tai lai Frame,neu k thi k can phai khoi tao */
	public static Fragment newinstance() {
		if (instace == null)
			instace = new ProfileUserFragment();

		return instace;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View vi = inflater.inflate(R.layout.user, null);
		tableView = (UITableView_User) vi.findViewById(R.id.listview_user);
		//tableView_name=(UITableView_User)vi.findViewById(R.id.listview_user_name);
		//tableView2 = (UITableView) vi.findViewById(R.id.tableview2);

		/*
		 * Tạo Button cho UItableView
		 */
		// buttonview=(UIButton_User)vi.findViewById(R.id.button_view);

		createList();
		createList2();
		/*
		 * Commit nó lên
		 */
		tableView.commit(R.layout.list_item_user,R.layout.list_item_user,R.layout.list_item_user);
		//tableView_name.commit(R.layout.list_item_user,R.layout.list_item_user,R.layout.list_item_user);
		return vi;
	}

	/*
	 * Tao ra cach Item cho UItableView
	 */
	private void createList() {
		tableView.addBasicItem(R.drawable.add_contact, "Trang cá nhân", "");
		tableView.addBasicItem(R.drawable.add_user_goi_y, "Thay đổi tài khoản", "");

	}

	private void createList2() {
		
		//tableView_name.addBasicItem(R.drawable.search_contact, "Tìm Bạn", "");
		tableView.addBasicItem(R.drawable.add_user_goi_y, "Thoát ứng dụng", "");
	}

}
